package com.qf.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

@Component
public class JedisUtils implements RedisUtils {
    @Autowired
    private Jedis jedis;
    @Override
    public String get(String key) {
        String s = jedis.get(key);
        return s;
    }

    @Override
    public String set(String key, String value) {
        String set = jedis.set(key, value);
        return set;
    }

    @Override
    public long expire(String key, int second) {
        Long expire = jedis.expire(key, second);
        return expire;
    }

    @Override
    public long ttl(String key) {
        Long ttl = jedis.ttl(key);
        return ttl;
    }

    @Override
    public long hset(String key, String feild, String value) {
        Long hset = jedis.hset(key, feild, value);
        return hset;
    }

    @Override
    public String hget(String key, String feild) {
        String hget = jedis.hget(key, feild);
        return hget;
    }
}
